package fr.mathis.ouestcharlie;

import android.content.Context;
import android.content.SharedPreferences;

public class DataManager {

	public static void MemorizeValue(String name, String value, Context c) {
		SharedPreferences settings = c.getSharedPreferences("data", 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(name, value);
		editor.commit();
	}

	public static String GetMemorizedValue(String name, Context c) {
		SharedPreferences settings = c.getSharedPreferences("data", 0);
		return settings.getString(name, null);
	}

	public static void MemorizeValue(String name, boolean value, Context c) {
		SharedPreferences settings = c.getSharedPreferences("data", 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putBoolean(name, value);
		editor.commit();
	}

	public static boolean GetMemorizedValueBoolean(String name, Context c) {
		SharedPreferences settings = c.getSharedPreferences("data", 0);
		return settings.getBoolean(name, false);
	}

}
